package main

import (
	"fmt"
)

func main() {
	/**
	创建map三种方式
	1. var map1 map[key][value]
	2. var map2 =make(map[string]string)
	3. var map3 =map[string]string{key:value,key:value}

	map是引用类型，slice也是引用类型，channel也是引用类型
	*/
	map1 := make(map[string]string, 8)
	// 存储map
	map1["ylf"] = "zxx"

	// 获取value值
	fmt.Println(map1["ylf"])

	// 删除通过delete(map1,"ylf)

	// map遍历
	for key, value := range map1 {
		fmt.Println(key)
		fmt.Println(value)
	}

}
